import request from '@/utils/request'

// 获取一级分类商品数据
export const reqGetCategory1List = ()=>request({
    url:`/admin/product/getCategory1`,
    method:'get'
})

// 获取二级分类商品数据
export const reqGetCategory2List = (params)=>request({
    url:`/admin/product/getCategory2/${params.category1Id}`,
    method:'get'
})

// 获取三级分类商品数据
export const reqGetCategory3List = (params)=>request({
    url:`/admin/product/getCategory3/${params.category2Id}`,
    method:'get'
})

// 根据选中的一级、二级、三级分类获取选中商品的属性数据
export const reqGetAttrInfoList = (params)=>request({
    url:`/admin/product/attrInfoList/${params.category1Id}/${params.category2Id}/${params.category3Id}`,
    method:'get'
})

// 保存新增的属性名和属性值列表
export const reqSaveAttrInfo = (data)=>request({
    url:'/admin/product/saveAttrInfo',
    method:'post',
    data
})

// 删除属性
export const reqDeleteAttrValue = ({id})=>request({
    url:`/admin/product/removeCategory3/${id}`,
    method:'delete'
})